package org.apache.hbase.example;

import java.io.IOException;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;

public class HbaseUtil {

	static Configuration cfg;
    static Connection connection;
 
    static {
        cfg = HBaseConfiguration.create();
        try {
            connection = ConnectionFactory.createConnection(cfg);
        } catch (IOException e) {
            e.printStackTrace();
        }
        //System.out.println(cfg.get("hbase.master"));
    }
    
    public static Connection getConnection(){
    	return connection;
    }
    
    public static void main(String[] args) throws IOException {
		Connection con = getConnection();
		System.out.println(con);
		con.close();
	}
}
